package com.np.demo1.interface1;

public class Class2 {

    public void test1(){
        Child2 child2 = new Child2();
        child2.f2();
    }

    public abstract class Child1 {

        public Child1(){
            System.out.println("Child1 构造函数");
        }
        protected abstract void f1();

        public void f2() {
            System.out.println("Child1.f2()");
            f1();
        }
    }

    public class Child2 extends Child1 {

        public Child2(){
            System.out.println("Child2 构造函数");
        }

        @Override
        protected void f1() {
            System.out.println("Child2.f1()");
            System.out.println("hello");
        }
    }
}
